<?PHP 

$start = "files/"; 
$handle = opendir($start); 
$hostname = "localhost";
$path = "flex2/files/";

/*  Making an array containing the files in the current directory: */ 
while ($folder = readdir($handle)) 
{ 
    $folders[] = $folder; 
} 
closedir($handle); 

/* echo the files  
$output = header("Content-type: text/xml");

return $output;
*/ 
echo "<?xml version=\"1.0\" ?>\r\n";
echo "<rss version=\"2.0\">\r\n";
foreach ($folders as $folder) { 
	echo "<item>\r\n";
	echo "<bildeurl>http://$hostname/$path$start$folder</bildeurl>\r\n";
	echo "</item>\r\n";
} 
echo "</rss>";
?> 